set nu
set relativenumber
set cursorline
set wrap
set tabstop=4
set shiftwidth=4
set hlsearch
set showcmd
set laststatus=2
set ignorecase

set foldmethod=indent
set foldenable

" command 
set wildmenu
" operation
let mapleader=" "
noremap <LEADER><CR> :noh<CR>

" window jump
nmap <LEADER>h <C-w>h
nmap <LEADER>l <C-w>l
nmap <LEADER>j <C-w>j
nmap <LEADER>k <C-w>k

" Autocomplete
set dictionary+=/home/sidpku/git-repo/snippets/vim-dict/dict-func.txt
set dictionary+=/home/sidpku/git-repo/snippets/vim-dict/dict-matlab.txt

" set path for python3
let g:python3_host_prog='/usr/bin/python3'

call plug#begin(stdpath('data') . '/plugged')
" plug for matlab
" Multiple Plug commands can be written in a single line using | separators
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'preservim/nerdtree'
Plug 'preservim/tagbar'
Plug 'tpope/vim-surround'
Plug 'junegunn/vim-easy-align'
Plug 'tpope/vim-repeat'
Plug 'andymass/vim-matlab'
Plug 'google/vim-searchindex'
Plug 'easymotion/vim-easymotion'
Plug 'kshenoy/vim-signature'
Plug 'preservim/vim-markdown'
Plug 'lervag/vimtex'
call plug#end()

" plugin setting
" UltiSnips 
" -------------------------------------------------------
let g:UltiSnipsSnippetDirectories=["UltiSnips", "mysnippets"]
let g:UltiSnipsExpandTrigger="<c-j>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"


" coc config
" -------------------------------------------
let g:coc_disable_startup_warning = 1
let g:coc_global_extensions = ['coc-vimlsp',
			\ 'coc-marketplace',
			\ 'coc-python',
			\ 'coc-dictionary' ]

" some config for coc running
" quick response
set updatetime=100
" less info on suggest
set shortmess+=c


" TagBar
" ------------------------------------
nmap <leader>t :Tagbar<CR> 
" sorted by appearance order
let g:tagbar_sort = 0
" add support for section
let g:tagbar_type_matlab = {
    \ 'kinds' : [
		\ 'S:section:0:0',
        \ 'f:functions',
        \ 'v:variables:1:0',
    \ ],
\ }

" vim-easy-align
" ------------------------------
" Start interactive EasyAlign in visual mode
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object
nmap ga <Plug>(EasyAlign)

" vim markdown
" ----------------------------------
set conceallevel=2
let g:vim_markdown_conceal_code_blocks = 0
let g:vim_markdown_fenced_languages = ['shell=sh']
" no conceal in math environment
let g:tex_conceal = ""
let g:vim_markdown_math = 1
" set fold level to section
let g:vim_markdown_folding_level = 2


" vimtex
" ----------------------------------------
let g:vimtex_compiler_enabled = 0
let g:vimtex_syntax_conceal = {
	  \ 'accents': 0,
	  \ 'cites': 1,
	  \ 'fancy': 1,
	  \ 'greek': 1,
	  \ 'math_bounds': 0,
	  \ 'math_delimiters': 1,
	  \ 'math_fracs': 0,
	  \ 'math_super_sub': 0,
	  \ 'math_symbols': 1,
	  \ 'sections': 0,
	  \ 'styles': 0,
	  \}
let g:vimtex_syntax_conceal_cites = {
	\ 'type':'brackets',
	\ 'verbose': 'v:false',
	\}



" nerdtree
" ----------------------------------------
nmap <LEADER>n :NERDTree<CR> :set nu<CR>
